import React from 'react';
import Request from '@utils/request.js';
import RcTable from '@components/Table/Table.jsx';
export default class TableBasic extends React.Component {

  componentWillMount() {
    Request.axiosRes({
      method: 'post',
      url:"/login",
      data: {
        "userId": "123567",
        "password": "123456",
        "showLoading": true
      }
    }).then()
  }

  render() {
    const dataSource = [];

    const columns = [
      { title: 'Age', dataIndex: 'age', key: 'age'},
      { title: 'Column 1', dataIndex: 'address', key: "address" },
      { title: 'Column 2', dataIndex: 'name', key: "name" },
      { title: 'Column 3', dataIndex: 'class', key: "class" },
    ];
    
    for (let i = 0; i < 100; i++) {
      dataSource.push({
        key: i,
        name: `Edrward ${i}`,
        age: 32,
        address: `London no. ${i}`,
        class: `class ${i}`
      });
    }

    return (
      <div className="home-page">
        <RcTable
          rowKey={record => record.key}
          columns={columns}
          dataSource={dataSource}
          pagination={{
            size: 'normal',
            showSizeChanger: true,
            showQuickJumper: true
          }}
          onChange={() => {}}
        />
      </div>
    );
  }
}